cmake_minimum_required(VERSION 2.6)
project(Game)

include_directories(
    ${PROJECT_SOURCE_DIR}
)

set(GameSRC
    ErrorHandler.cc
    Global.h
    GameApplication.h
    GameApplication.cc
    Common.h
    Common.cc
    
    Game/DBCEnum.h
    Game/DBCFmt.h
    Game/DBCStores.h
    Game/DBCStores.cc
    Game/DBCStructure.h
    Game/SQLStorageFmt.h
    Game/SQLStorages.h
    Game/SQLStorages.cc
    Game/SharedDefines.h
    Game/Pet.h
    Game/Map.h
    Game/MapManager.h
    Game/MapManager.cc
    Game/ObjectManager.h
    Game/ObjectManager.cc
    Game/ObjectManagerLoad.cc
    Game/GridDefines.h
    Game/ObjectGuid.h
    Game/ObjectGuid.cc
    Game/ItemPrototype.h
    Game/Player.h
    Game/Player.cc
    Game/PlayerDefines.h
    Game/PlayerCharacter.cc
    Game/Creature.h
    
    Server/WorldConnection.h
    Server/WorldConnection.cc
    Server/WorldConnectionFactory.h
    Server/ConnectionManager.h
    Server/ConnectionManager.cc
    Server/WorldSession.h
    Server/WorldSession.cc
    Server/PacketFilter.h
    Server/PacketFilter.cc
    Server/OpcodeHandler.h
    Server/OpcodeHandler.cc
    
    World/World.h
    World/World.cc
    World/WorldRunnable.h
    World/WorldRunnable.cc
    World/WorldTimer.h
    World/WorldTimer.cc
    World/WorldLoad.cc
    World/AddonHandler.h
    World/AddonHandler.cc
    World/WorldDefines.h
    World/CharacterHandler.cc
)
if(WIN32)
set(GameSRC
    Main_WIN32.cc
${GameSRC})
endif()

add_executable(Game 
    ${GameSRC}
)
target_link_libraries(Game
    Ucop
    ${Libevent_Libs}
    ${TinyXML_Libs}
    ${MySQL_Libs}
    ${OpenSSL_Libs}
    Shared
    zlib
)

if (WIN32)
target_link_libraries(Game ws2_32 dbghelp)
endif()